home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ImageMagick / xtp / get next >
Encoding:
Text File  |  1994-08-02  |  541 b   |  22 lines

  1. #!/usr/bin/perl
  2. #
  3. # Retrieve files from remote host using standard 'host: filename' string:
  4. #
  5. #   get export.lcs.mit.edu: contrib/ImageMagick.tar.Z
  6. #
  7. $host=shift || die "Usage: get host/ip-address file\n";
  8. $file=shift || die "Usage: get host/ip-address file\n";
  9. $host=~s/:$//;
  10. $directory=`dirname $file`;
  11. chop($directory);
  12. $file=`basename $file`;
  13. chop($file);
  14. printf("Getting %s in directory %s from host %s...\n",$file,$directory,$host);
  15. $pid=fork;
  16. if ($pid == 0)
  17.   {
  18.     exec("xtp -r $file -b $host $directory");
  19.     exit(0);
  20.   }
  21. exit(0);
  22.